package zut.process;

public class ZuiZhi {
    public static void main(String[] args) {
        int[] arr = {11,55,22,44,33};
        int[] maxAndMin =  getMaxMin(arr);
        System.out.println(maxAndMin[0]);
        System.out.println(maxAndMin[1]);
    }
    public  static int[] getMaxMin(int[] arr){
        int max = arr[0];
        for (int i = 1;i< arr.length;i++){
            if(max<arr[i]){
                max = arr[i];
            }
        }
        int min = arr[0];
        for (int i = 1;i< arr.length;i++){
            if(min>arr[i]){
                min = arr[i];
            }
            int[] maxAndMin = {min,max};
        return maxAndMin ;
        }
        return arr;
    }
}
//return语句只能带回一个结果